package com.xqboss.apps.convert.user;

import com.xqboss.apps.domain.consumer.ConsumerRealName;
import com.xqboss.apps.domain.user.SysUserWalletWithdrawHandler;
import com.xqboss.apps.vo.user.AppWithdrawDetailVo;
import com.xqboss.apps.vo.user.WithdrawDetailVo;
import com.xqboss.apps.vo.user.WithdrawHandlerListVo;
import com.xqboss.apps.vo.user.WithdrawListVo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.MappingTarget;

import java.util.List;

/**
 * @author Trent
 * @date 2023/8/21
 */
@Mapper(componentModel = "spring")
public interface WithdrawConverter {

    /**
     * 转换WEB端提现详情
     * @param withdrawVo
     * @param handlerList
     * @param realName
     * @return
     */
    @Mapping(source = "realName", target = "realName")
    @Mapping(source = "handlerList", target = "handlerList")
    @Mapping(source = "withdrawVo.id", target = "id")
    @Mapping(source = "withdrawVo.userId", target = "userId")
    @Mapping(source = "withdrawVo.createTime", target = "createTime")
    @Mapping(source = "withdrawVo.updateTime", target = "updateTime")
    WithdrawDetailVo toWithdrawDetailVo(WithdrawListVo withdrawVo, List<SysUserWalletWithdrawHandler> handlerList, ConsumerRealName realName);

    /**
     * 转换APP提现详情
     * @param withdrawVo
     * @param handlerList
     * @return
     */
    AppWithdrawDetailVo toAppWithdrawDetailVo(WithdrawListVo withdrawVo, List<SysUserWalletWithdrawHandler> handlerList);

    /**
     * 转换提现操作列表
     * @param handlerList
     * @return
     */
    List<WithdrawHandlerListVo> toHandlerList(List<SysUserWalletWithdrawHandler> handlerList);
}
